home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Topik / Topik - Disk 37 - Games 3 (19xx)(Topik Public Domain)(PD)[WB].zip / Topik - Disk 37 - Games 3 (19xx)(Topik Public Domain)(PD)[WB].adf / RUMMY / SOURCE / decl.c.pp / decl.c
C/C++ Source or Header  |  1991-02-24  |  19KB  |  520 lines

  1. /* DECL.C
  2.  * This file contains instances of various structures whose templates are
  3.  * contained in the file DEFNS.H. This file should be compiled and linked
  4.  * the other modules
  5.  */
  6.  
  7. #include    <intuition/intuition.h>
  8. #include    "defns.h"
  9.  
  10. extern    struct    Gadget    cardgads[];
  11.  
  12. struct    IntuitionBase    *IntuitionBase;
  13. struct    GfxBase    *GfxBase;
  14. struct    TextAttr    defaultfont =
  15. {    (STRPTR)"topaz.font", TOPAZ_EIGHTY, FS_NORMAL, FPF_ROMFONT },
  16. italicfont = {    (STRPTR)"topaz.font", TOPAZ_EIGHTY, FSF_ITALIC, FPF_ROMFONT };
  17.  
  18. struct    NewScreen    scrspec =
  19. {
  20.     0,0,640,256, 3, 4,1,
  21.     HIRES,CUSTOMSCREEN | SCREENBEHIND, &defaultfont,
  22.     "Rummy by Simon Preene, Copyright Amiga Computing 1990", NULL,NULL
  23. };
  24. struct    Screen    *scr;
  25.  
  26. USHORT    chip    ptr1[] =
  27. {
  28.     0x0000,0x0000,0xfe00,0xfe00,0xfe00,0x8200,0xfc00,0x8400,
  29.     0xfc00,0x8400,0xfe00,0x8200,0xff00,0xa100,0xcf80,0xc880,
  30.     0x07c0,0x0440,0x03e0,0x0220,0x01f0,0x0110,0x00f8,0x0088,
  31.     0x007c,0x0044,0x0038,0x0028,0x0010,0x0010,0x0000,0x0000
  32. };
  33.  
  34. USHORT    chip    plr1ptr[] =
  35. {
  36.     0x0000,0x0000,0xfe00,0xfe00,0xfe00,0x8200,0xfc00,0x8400,
  37.     0xfc00,0x8400,0xfe00,0x8200,0xff00,0xb100,0xcf80,0xc880,
  38.     0x07c0,0x0440,0x03e0,0x0220,0x01f0,0x0110,0x00f8,0x0088,
  39.     0x007c,0x0044,0x03b8,0x03a8,0x0690,0x0790,0x1c80,0x1f80,
  40.     0x1080,0x1f80,0x1c80,0x1f80,0x0480,0x0780,0x0480,0x0780,
  41.     0x0480,0x0780,0x0480,0x0780,0x0480,0x0780,0x0480,0x0780,
  42.     0x0480,0x0780,0x0480,0x0780,0x0480,0x0780,0x0480,0x0780,
  43.     0x0480,0x0780,0x3cf0,0x3ff0,0x2010,0x3ff0,0x3ff0,0x3ff0,
  44.     0x0000,0x0000
  45. };
  46.     
  47. USHORT    chip    plr2ptr[] =
  48. {
  49.     0x0000,0x0000,0xfe00,0xfe00,0xfe00,0x8200,0xfc00,0x8400,
  50.     0xfc00,0x8400,0xfe00,0x8200,0xff00,0xb100,0xcf80,0xc880,
  51.     0x07c0,0x0440,0x03e0,0x0220,0x01f0,0x0110,0x00f8,0x0088,
  52.     0x007c,0x0044,0x0fb8,0x0fa8,0x38f0,0x3ff0,0x2030,0x3ff0,
  53.     0x6f10,0x7ff0,0x5990,0x79f0,0x5090,0x70f0,0x7090,0x70f0,
  54.     0x0190,0x01f0,0x0130,0x01f0,0x0320,0x03e0,0x0260,0x03e0,
  55.     0x06c0,0x07c0,0x0c80,0x0f80,0x1980,0x1f80,0x3338,0x3f38,
  56.     0x67e8,0x7ff8,0x4008,0x7ff8,0x4018,0x7ff8,0x7ff0,0x7ff0,
  57.     0x0000,0x0000 
  58. };
  59.  
  60. USHORT    chip    plr3ptr[] =
  61. {
  62.     0x0000,0x0000,0xfe00,0xfe00,0xfe00,0x8200,0xfc00,0x8400,
  63.     0xfc00,0x8400,0xfe00,0x8200,0xff00,0xb100,0xcf80,0xc880,
  64.     0x07c0,0x0440,0x03e0,0x0220,0x01f0,0x0110,0x00f8,0x0088,
  65.     0x007c,0x0044,0x0fb8,0x0fa8,0x38d0,0x3fd0,0x2060,0x3fe0,
  66.     0x6e20,0x7fe0,0x5b20,0x7be0,0x5320,0x73e0,0x7660,0x77e0,
  67.     0x0cc0,0x0fc0,0x0860,0x0fe0,0x0e30,0x0ff0,0x0310,0x03f0,
  68.     0x0190,0x01f0,0x0090,0x00f0,0x0090,0x00f0,0x79b0,0x79f0,
  69.     0x4f20,0x7fe0,0x4660,0x7fe0,0x61c0,0x7fc0,0x3f00,0x3f00,
  70.     0x0000,0x0000
  71. };
  72.  
  73. struct    custptr    ptrs[] =
  74. {
  75.     { ptr1,14,16,-1,0 },
  76.     { plr1ptr, 31,16,-1,0, },
  77.     { plr2ptr, 31,16,-1,0 },
  78.     { plr3ptr, 31,16,-1,0 }
  79. };
  80.  
  81.  
  82. struct    playerinfo    plr1 =
  83. {    1,1,"User",4,0,1,NULL,0,P1DX,P1DY };
  84.  
  85. struct    playerinfo    plr2 =
  86. {    0,0,"Lisa",4,0,2,NULL,0,P2DX,P2DY };
  87.     
  88. struct    playerinfo    plr3 =
  89. {    0,0,"Mike",4,0,3,NULL,0,P3DX,P3DY };
  90. /* The memory and hand arrays will be set by the program */
  91. /* Extra space in name fields is so that user can change name easily */
  92.  
  93. struct    playerinfo    *plr[] =
  94. {    NULL,&plr1,&plr2,&plr3 };
  95.  
  96. USHORT    chip    faceinfo[] = /*data for full face boolinfo*/
  97. {
  98.     0x0fff,0xffff,0xffff,0xfff0,0x3fff,0xffff,0xffff,0xfffc,
  99.     0x7fff,0xffff,0xffff,0xfffe,0x7fff,0xffff,0xffff,0xfffe,
  100.     0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
  101.     0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
  102.     0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
  103.     0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
  104.     0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
  105.     0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
  106.     0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
  107.     0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
  108.     0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
  109.     0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
  110.     0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
  111.     0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
  112.     0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
  113.     0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
  114.     0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
  115.     0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
  116.     0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
  117.     0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
  118.     0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
  119.     0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
  120.     0x7fff,0xffff,0xffff,0xfffe,0x7fff,0xffff,0xffff,0xfffe,
  121.     0x3fff,0xffff,0xffff,0xfffc,0x0fff,0xffff,0xffff,0xfff0
  122. },
  123. chip    edgeinfo[] = /*data for edge boolinfo*/
  124. {
  125.     0x0fff,0xfff0,0x3fff,0xf000,
  126.     0x7fff,0xe000,0x7fff,0xe000,
  127.     0xffff,0x0000,0xffff,0x0000,
  128.     0xffff,0x0000,0xffff,0x0000,
  129.     0xffff,0x0000,0xffff,0x0000,
  130.     0xffff,0x0000,0xffff,0x0000,
  131.     0xffff,0x0000,0xffff,0x0000,
  132.     0xffff,0x0000,0xffff,0x0000,
  133.     0xffff,0x0000,0xffff,0x0000,
  134.     0xffff,0x0000,0xffff,0x0000,
  135.     0xffff,0x0000,0xffff,0x0000,
  136.     0xffff,0x0000,0xffff,0x0000,
  137.     0xffff,0x0000,0xffff,0x0000,
  138.     0xffff,0x0000,0xffff,0x0000,
  139.     0xffff,0x0000,0xffff,0x0000,
  140.     0xffff,0x0000,0xffff,0x0000,
  141.     0xffff,0x0000,0xffff,0x0000,
  142.     0xffff,0x0000,0xffff,0x0000,
  143.     0xffff,0x0000,0xffff,0x0000,
  144.     0xffff,0x0000,0xffff,0x0000,
  145.     0xffff,0x0000,0xffff,0x0000,
  146.     0xffff,0x0000,0xffff,0x0000,
  147.     0x7fff,0x8000,0x7fff,0x8000,
  148.     0x3fff,0xe000,0x0fff,0xe000,
  149.     0x0fff,0xf000,0x07ff,0xfff0
  150. };
  151.  
  152. struct    BoolInfo    wide = { BOOLMASK, faceinfo, NULL},
  153.             narrow = { BOOLMASK, edgeinfo, NULL};
  154.  
  155.  
  156. char    handbuf[4]="7",undo[4][30];    /*each name gadget has its own undo buffer*/
  157. struct    StringInfo    strinfo[] =
  158. {
  159.     { (UBYTE *)plr1.name,undo[0], 0,16,0,0,16,16,0,0,NULL,0,NULL },
  160.     { (UBYTE *)plr2.name,undo[1], 0,16,0,0,16,16,0,0,NULL,0,NULL },
  161.     { (UBYTE *)plr3.name,undo[2], 0,16,0,0,16,16,0,0,NULL,0,NULL },
  162.     { handbuf,undo[3], 0,4,0,0 }
  163. };
  164. USHORT    bcrds[][10] =
  165. {
  166.     { 0,0, 16*FWIDTH+3,0, 16*FWIDTH+3,FHEIGHT+3, 0,FHEIGHT+3, 0,0 },
  167.     { 0,0, 8*FWIDTH+3,0, 8*FWIDTH+3,FHEIGHT+3, 0,FHEIGHT+3, 0,0 },
  168.     { 0,0, 14*FWIDTH+3,0, 14*FWIDTH+3,FHEIGHT+3, 0,FHEIGHT+3, 0,0 },
  169.     { 0,0, 4*FWIDTH+3,0, 4*FWIDTH+3,FHEIGHT+1, 0,FHEIGHT+1, 0,0}
  170. };
  171. struct    Border    brd[] =
  172. {
  173.     { -2,-2,2,1, JAM1, 5, bcrds[0], NULL },
  174.     { 0,0,2,1, JAM1, 5, bcrds[1], NULL },
  175.     { 0,0,2,1, JAM1, 5, bcrds[2], NULL },
  176.     { -1,-1,2,1, JAM1, 5, bcrds[3], NULL}
  177. };
  178. struct    IntuiText    gadtxt[] =
  179. {
  180.     { 2,1,JAM2,2,2,NULL, "Continue", NULL },
  181.     { 2,1,JAM2,2,2,NULL, "Submit New Set", NULL },
  182.     { 1,0,JAM2,-14 * FWIDTH + 2,1,NULL, "No of Rounds",NULL}
  183. };
  184. struct    Gadget    stdgad[] =
  185. {
  186.     { &stdgad[1],P1DX+NGPX,P1DY+NGPY,16*FWIDTH,FHEIGHT, GADGHCOMP,NULL,
  187.       STRGADGET, (APTR)&brd[0], NULL,NULL,NULL, (APTR)&strinfo[0],
  188.       N1G,NULL    
  189.     },
  190.     { &stdgad[2],P2DX+NGPX,P2DY+NGPY,16*FWIDTH,FHEIGHT, GADGHCOMP,NULL,
  191.       STRGADGET, (APTR)&brd[0], NULL,NULL,NULL, (APTR)&strinfo[1],
  192.       N2G,NULL    
  193.     },
  194.     { NULL,P3DX+NGPX,P3DY+NGPY,16*FWIDTH,FHEIGHT, GADGHCOMP,NULL,
  195.       STRGADGET, (APTR)&brd[0], NULL,NULL,NULL, (APTR)&strinfo[2],
  196.       N3G,NULL    
  197.     }, /*not linked to gad[4] since rest only needed during gameplay*/
  198.     { &stdgad[4],IDX+175,IDY+55,8*FWIDTH+4,FHEIGHT+4,GADGHCOMP,RELVERIFY,
  199.       BOOLGADGET, (APTR)&brd[1], NULL, &gadtxt[0], NULL,NULL,CONTG,NULL
  200.     },
  201.     { &stdgad[5],500,15,14*FWIDTH+4,FHEIGHT+4,GADGHCOMP,RELVERIFY,
  202.       BOOLGADGET, (APTR)&brd[2], NULL, &gadtxt[1], NULL,NULL,SUBMITG,NULL
  203.     },
  204.     { &stdgad[6],FUPX-2,FUPY-2,CARDW+4,CARDH+4,GADGHBOX, TOGGLESELECT | RELVERIFY,
  205.       BOOLGADGET, NULL,NULL,NULL,NULL,NULL,FUPG,NULL
  206.     },
  207.     { &stdgad[7],FDPX-2,FDPY-2,CARDW+4,CARDH+4,GADGHBOX, TOGGLESELECT | RELVERIFY,
  208.       BOOLGADGET, NULL,NULL,NULL,NULL,NULL,FDPG,NULL
  209.     },
  210.     { NULL,NHGADX,NHGADY,10*FWIDTH,FHEIGHT, GADGHCOMP,LONGINT | RELVERIFY,
  211.       STRGADGET,(APTR)&brd[3],NULL,&gadtxt[2], NULL,(APTR)&strinfo[3],NHANDG,NULL
  212.     }
  213. };
  214.  
  215. struct    Gadget    hgads[] =    /*hand gadgets for cards*/
  216. {
  217.     { NULL },    /*for correlation with PLRn->HAND[]*/
  218.     { NULL,HANDLEFT,0,64,48,GADGHCOMP,  BOOLEXTEND | TOGGLESELECT | RELVERIFY, BOOLGADGET,
  219.       NULL,NULL,NULL,NULL,(APTR)&wide, HANDG1, NULL},
  220.     { NULL,HANDLEFT-17,0,17,48,GADGHCOMP,BOOLEXTEND |  TOGGLESELECT | RELVERIFY, BOOLGADGET,
  221.       NULL,NULL,NULL,NULL,(APTR)&narrow, HANDG2, NULL},
  222.     { NULL,HANDLEFT-17*2,0,17,48,GADGHCOMP,BOOLEXTEND |  TOGGLESELECT | RELVERIFY, BOOLGADGET,
  223.       NULL,NULL,NULL,NULL,(APTR)&narrow, HANDG3, NULL},
  224.     { NULL,HANDLEFT-17*3,0,17,48,GADGHCOMP,BOOLEXTEND |  TOGGLESELECT | RELVERIFY, BOOLGADGET,
  225.       NULL,NULL,NULL,NULL,(APTR)&narrow, HANDG4, NULL},
  226.     { NULL,HANDLEFT-17*4,0,17,48,GADGHCOMP,BOOLEXTEND |  TOGGLESELECT | RELVERIFY, BOOLGADGET,
  227.       NULL,NULL,NULL,NULL,(APTR)&narrow, HANDG5, NULL},
  228.     { NULL,HANDLEFT-17*5,0,17,48,GADGHCOMP,BOOLEXTEND |  TOGGLESELECT | RELVERIFY, BOOLGADGET,
  229.       NULL,NULL,NULL,NULL,(APTR)&narrow, HANDG6, NULL},
  230.     { NULL,HANDLEFT-17*6,0,17,48,GADGHCOMP,BOOLEXTEND |  TOGGLESELECT | RELVERIFY, BOOLGADGET,
  231.       NULL,NULL,NULL,NULL,(APTR)&narrow, HANDG7, NULL}
  232. };
  233.  
  234. struct    Gadget    setgads[] =    /*gadgets for face-up-sets*/
  235. {
  236.     { NULL,0,40,0,48, GADGHBOX, RELVERIFY, BOOLGADGET,
  237.       NULL,NULL,NULL,NULL,NULL,SETGAD0,NULL},
  238.     { NULL,0,113,0,48, GADGHBOX, RELVERIFY, BOOLGADGET,
  239.       NULL,NULL,NULL,NULL,NULL,SETGAD1,NULL},
  240.     { NULL,0,186,0,48, GADGHBOX, RELVERIFY, BOOLGADGET,
  241.       NULL,NULL,NULL,NULL,NULL,SETGAD2,NULL},
  242.     { NULL,0,186,0,48, GADGHBOX, RELVERIFY, BOOLGADGET,
  243.       NULL,NULL,NULL,NULL,NULL,SETGAD3,NULL},
  244.     { NULL,0,113,0,48, GADGHBOX, RELVERIFY, BOOLGADGET,
  245.       NULL,NULL,NULL,NULL,NULL,SETGAD4,NULL},
  246.     { NULL,0,40,0,48, GADGHBOX, RELVERIFY, BOOLGADGET,
  247.       NULL,NULL,NULL,NULL,NULL,SETGAD5,NULL}
  248. };
  249. ULONG    setpos[] = {40,113,186,186,113,40};
  250.  
  251. struct    NewWindow    winspec =
  252. {
  253.     0,0,640,255, 4,1,
  254.     GADGETUP | MENUPICK,
  255.     SMART_REFRESH | BORDERLESS | BACKDROP | ACTIVATE | NOCAREREFRESH,
  256.     stdgad, NULL,NULL,NULL,NULL,
  257.     640,246,640,246,
  258.     CUSTOMSCREEN
  259. };
  260. struct    Window    *wind;
  261.  
  262. struct    IntuiText    inittxt[] =
  263. {
  264.     { 1,0,JAM1,IDX+180,IDY+12,NULL,"Next Player . . .",&inittxt[1] },
  265.     { 1,0,JAM1,IDX+MESX,IDY+MESY, NULL,"Use Menus To Play",&inittxt[2]},
  266.     { 1,0,JAM1,362,17, NULL,"Submitted Sets",&inittxt[3]},
  267.     { 1,0,JAM1,P1DX+SCTPX,P1DY+SCTPY, NULL,"Score       ",&inittxt[4]},
  268.     { 1,0,JAM1,P1DX+HVTPX,P1DY+HVTPY, NULL,"Hand Value      ",&inittxt[5]},
  269.     { 1,0,JAM1,P1DX+NWTPX,P1DY+NWTPY, NULL,"Wins       ",&inittxt[6]},
  270.     { 1,0,JAM1,P2DX+SCTPX,P2DY+SCTPY, NULL,"Score       ",&inittxt[7]},
  271.     { 1,0,JAM1,P2DX+HVTPX,P2DY+HVTPY, NULL,"Hand Value      ",&inittxt[8]},
  272.     { 1,0,JAM1,P2DX+NWTPX,P2DY+NWTPY, NULL,"Wins       ",&inittxt[9]},
  273.     { 1,0,JAM1,P3DX+SCTPX,P3DY+SCTPY, NULL,"Score       ",&inittxt[10]},
  274.     { 1,0,JAM1,P3DX+HVTPX,P3DY+HVTPY, NULL,"Hand Value      ",&inittxt[11]},
  275.     { 1,0,JAM1,P3DX+NWTPX,P3DY+NWTPY, NULL,"Wins       ",&inittxt[12]},
  276.     { 1,0,JAM1,P1DX+NWTPX,P1DY+NWTPY+9,NULL,"Turn       ",&inittxt[13]},
  277.     { 1,0,JAM1,P2DX+NWTPX,P2DY+NWTPY+9,NULL,"Turn       ",&inittxt[14]},
  278.     { 1,0,JAM1,P3DX+NWTPX,P3DY+NWTPY+9,NULL,"Turn       ",NULL}
  279. },
  280. gt =    { 1,0,JAM2,0,0,NULL,NULL,NULL };
  281.  
  282. struct    IntuiText    abprtxt =    /*about texts*/
  283. { 2,1,JAM1,2,2,NULL,"Proceed",NULL};
  284.  
  285. USHORT    abprbcrds[] =
  286. { 0,0, 7*FWIDTH+3,0, 7*FWIDTH+3,FHEIGHT+3, 0,FHEIGHT+3, 0,0};
  287.  
  288. struct    Border    abprbrd =    /*about gadget border*/
  289. { 0,0,2,0,JAM1,5,abprbcrds,NULL };
  290.  
  291. struct    Gadget    abgad =    /*about gadget*/
  292. { NULL,91,100,7*FWIDTH+4,FHEIGHT+4,GADGHCOMP, RELVERIFY | ENDGADGET,
  293.   BOOLGADGET | REQGADGET,(APTR)&abprbrd,NULL,&abprtxt,NULL,NULL,PROCG,NULL
  294. };
  295.  
  296. USHORT    abbrdcrds[] = {0,0,239,0,239,119,0,119,0,0};
  297. struct    Border    abbrd = {0,0,3,0,JAM1,5,abbrdcrds,NULL};
  298. struct    IntuiText    abouttxt[] =
  299. {
  300.     { 2,1,JAM1,100,5,NULL,"Rummy", &abouttxt[1]},
  301.     { 4,1,JAM1,60,30,NULL,"By Simon Preene",&abouttxt[2]},
  302.     { 4,1,JAM1,84,45,NULL,"September",&abouttxt[3] },
  303.     { 4,1,JAM1,104,60,NULL,"1990",&abouttxt[4]},
  304.     { 3,1,JAM1,100,15,NULL,"V1.00",&abouttxt[5]},
  305.     { 2,1,JAM1,20,80,NULL,"Copyright Amiga Computing",NULL}
  306. };
  307. struct    Requester    aboutr =     /*about requester*/
  308. { NULL,200,50,240,120,NULL,NULL,&abgad,&abbrd,&abouttxt[0],NULL,1 };
  309.  
  310. /*modify memory requester*/
  311. struct    IntuiText    mmtxt[] =
  312. {
  313.     { 1,1,JAM1,100,4,NULL,"Modify Memory :",&mmtxt[13] },
  314.     { 1,0,JAM1,290,20,NULL,"Memory Flags",NULL} ,
  315.     { 3,1,JAM2,2,2,NULL,"PREVPLRHOLDS",NULL },
  316.     { 3,1,JAM2,2,2,NULL,"CURRPLRHOLDS",NULL },
  317.     { 3,1,JAM2,2,2,NULL,"NEXTPLRHOLDS",NULL },
  318.     { 3,1,JAM2,2,2,NULL,"PREVPLRDROPD",NULL },
  319.     { 3,1,JAM2,2,2,NULL,"CURRPLRDROPD",NULL },
  320.     { 3,1,JAM2,2,2,NULL,"NEXTPLRDROPD",NULL },
  321.     { 3,1,JAM2,2,2,NULL,"  GONEPAST  ",NULL },
  322.     { 3,1,JAM2,2,2,NULL,"  INFUPSET  ",NULL },
  323.     { 2,1,JAM2,2,2,NULL,"    Save    ",NULL },
  324.     { 2,1,JAM2,2,2,NULL,"   Accept   ",NULL },
  325.     { 2,1,JAM2,2,2,NULL,"   Cancel   ",NULL },
  326.     { 1,1,JAM1,225,4,NULL,"",&mmtxt[1]} /*player name filled in*/
  327. };
  328.  
  329. USHORT    mmbcrds[2][10] = /*modmem border coords*/
  330. {
  331.     { 0,0, 12*FWIDTH+3,0, 12*FWIDTH+3,FHEIGHT+3, 0,FHEIGHT+3, 0,0 },
  332.     { 1,1, 12*FWIDTH+2,1, 12*FWIDTH+2,FHEIGHT+2, 1,FHEIGHT+2, 1,1 }
  333. };
  334.  
  335. USHORT    mmmainbcrds[] =
  336. { 0,0, 399,0, 399,219, 0,219, 0,0};
  337.  
  338. struct    Border    innerbrd =    /*inner border for modmem gadgets*/
  339. { 0,0,0,1,JAM2,5,mmbcrds[1],NULL};
  340.  
  341. struct    Border    mmbrd =    /*modify memory border*/
  342. { 0,0,3,1,JAM1,5,mmbcrds[0],&innerbrd };
  343.  
  344. struct    Border    mmmainbrd =
  345. { 0,0,1,1,JAM1,5,mmmainbcrds,NULL};
  346.  
  347. struct    Gadget    mmgads[] = /*modmem gadgets*/
  348. {
  349.     { &mmgads[1],290,30,12*FWIDTH+4,FHEIGHT+4,GADGHCOMP, TOGGLESELECT, BOOLGADGET | REQGADGET,
  350.       (APTR)&mmbrd,NULL,&mmtxt[2],NULL,NULL,NULL,NULL },
  351.     { &mmgads[2],290,43,12*FWIDTH+4,FHEIGHT+4,GADGHCOMP, TOGGLESELECT, BOOLGADGET | REQGADGET,
  352.       (APTR)&mmbrd,NULL,&mmtxt[3],NULL,NULL,NULL,NULL },
  353.     { &mmgads[3],290,56,12*FWIDTH+4,FHEIGHT+4,GADGHCOMP, TOGGLESELECT, BOOLGADGET | REQGADGET,
  354.       (APTR)&mmbrd,NULL,&mmtxt[4],NULL,NULL,NULL,NULL },
  355.     { &mmgads[4],290,69,12*FWIDTH+4,FHEIGHT+4,GADGHCOMP, TOGGLESELECT, BOOLGADGET | REQGADGET,
  356.       (APTR)&mmbrd,NULL,&mmtxt[5],NULL,NULL,NULL,NULL },
  357.     { &mmgads[5],290,82,12*FWIDTH+4,FHEIGHT+4,GADGHCOMP, TOGGLESELECT, BOOLGADGET | REQGADGET,
  358.       (APTR)&mmbrd,NULL,&mmtxt[6],NULL,NULL,NULL,NULL },
  359.     { &mmgads[6],290,95,12*FWIDTH+4,FHEIGHT+4,GADGHCOMP, TOGGLESELECT, BOOLGADGET | REQGADGET,
  360.       (APTR)&mmbrd,NULL,&mmtxt[7],NULL,NULL,NULL,NULL },
  361.     { &mmgads[7],290,108,12*FWIDTH+4,FHEIGHT+4,GADGHCOMP, TOGGLESELECT, BOOLGADGET | REQGADGET,
  362.       (APTR)&mmbrd,NULL,&mmtxt[8],NULL,NULL,NULL,NULL },
  363.     { &mmgads[8],290,121,12*FWIDTH+4,FHEIGHT+4,GADGHCOMP, TOGGLESELECT, BOOLGADGET | REQGADGET,
  364.       (APTR)&mmbrd,NULL,&mmtxt[9],NULL,NULL,NULL,NULL },
  365.     { &mmgads[9],290,140,12*FWIDTH+4,FHEIGHT+4,GADGHCOMP, RELVERIFY, BOOLGADGET | REQGADGET,
  366.       (APTR)&mmbrd,NULL,&mmtxt[10],NULL,NULL,MMSETFG,NULL},
  367.     { &mmgads[10],290,160,12*FWIDTH+4,FHEIGHT+4,GADGHCOMP, RELVERIFY | ENDGADGET, BOOLGADGET | REQGADGET,
  368.       (APTR)&mmbrd,NULL,&mmtxt[11],NULL,NULL,MMACCEPTG,NULL},
  369.     { &cardgads[1],290,173,12*FWIDTH+4,FHEIGHT+4,GADGHCOMP, RELVERIFY | ENDGADGET, BOOLGADGET | REQGADGET,
  370.       (APTR)&mmbrd,NULL,&mmtxt[12],NULL,NULL,MMCANCELG,NULL}
  371. }, 
  372.     cardgads[53] =    /*fully initialised when used*/
  373. {
  374.     { NULL,0,0,0,48,GADGHCOMP | GADGIMAGE, BOOLEXTEND | RELVERIFY | TOGGLESELECT, BOOLGADGET | REQGADGET,
  375.       NULL,NULL,NULL,NULL,NULL,NULL,NULL}
  376. };
  377.  
  378.  
  379. struct    Requester    mmreq = /*modify memory requester*/
  380. { NULL,120,11,400,220,0,0,&mmgads[0],&mmmainbrd,&mmtxt[0],NULL,0,
  381.     NULL,{NULL},NULL,NULL,{NULL} };
  382.  
  383. /*manual deal requester*/
  384. USHORT    mdbcrds[][10] =
  385. {
  386.     { 0,0, 8*FWIDTH+3,0, 8*FWIDTH+3,FHEIGHT+3, 0,FHEIGHT+3, 0,0 },
  387.     { 1,1, 399,1, 399,219, 1,219, 1,1}
  388. };
  389.  
  390. struct    Border    mdbrd[] =
  391. {
  392.     { 0,0,3,1,JAM1,5,mdbcrds[0],NULL },
  393.     { 0,0,1,1,JAM1,5,mdbcrds[1],NULL }
  394. };
  395.  
  396. struct    IntuiText    mdtxt[] =
  397. {
  398.     { 1,0,JAM1,160,5,NULL, "Manual Deal", NULL},
  399.     { 2,1,JAM2,2,2,NULL,"AutoDeal", NULL},
  400.     { 3,1,JAM2,2,2,NULL," Accept ",NULL },
  401.     { 1,0,JAM1,10,15,NULL,"Select cards for ",NULL}
  402. };
  403.  
  404. struct    StringInfo    mdstrinfo =
  405. { NULL,NULL,0,0,0};
  406.  
  407. struct    Gadget    mdgads[] =
  408. {
  409.     { &mdgads[1], 290,50, 8*FWIDTH+4,FHEIGHT+4, GADGHCOMP, RELVERIFY | ENDGADGET,
  410.       BOOLGADGET | REQGADGET, (APTR)&mdbrd[0],NULL, &mdtxt[1], NULL,NULL,MDAUTODG,NULL
  411.     },
  412.     { &mdgads[2], 500,15, 0,0, GADGHNONE, NULL, STRGADGET | REQGADGET, NULL,
  413.       NULL, NULL, NULL,(APTR)&mdstrinfo, NULL,NULL
  414.     },
  415.     { &cardgads[1], 290,80, 8*FWIDTH+4,FHEIGHT+4, GADGHCOMP, RELVERIFY,
  416.       BOOLGADGET | REQGADGET, (APTR)&mdbrd[0],NULL, &mdtxt[2], NULL,NULL,MDACCEPTG,NULL
  417.     }
  418. };
  419.  
  420. struct    Requester    mdreq =
  421. { NULL,220,11,400,220, 0,0, &mdgads[0], &mdbrd[1], &mdtxt[0], NULL,0,
  422.     NULL,{NULL},NULL,NULL,{NULL} };
  423.  
  424. /*display winner requester*/
  425. char    intbuf[8][4];
  426.  
  427. struct    IntuiText    rwtxt[] =
  428. {
  429.     { 4,1,JAM1,55,10,&italicfont,"Winner Of Round ",&rwtxt[1]},
  430.     { 4,1,JAM1,183,10,&italicfont,intbuf[3],&rwtxt[2]},
  431.     { 4,1,JAM1,207,10,&italicfont," Of ",&rwtxt[3]},
  432.     { 4,1,JAM1,247,10,&italicfont,intbuf[4],&rwtxt[4]},
  433.     { 3,1,JAM1,122,30,NULL,"",&rwtxt[5]},
  434.     { 4,1,JAM1,54,50,&italicfont,"Player             Score",&rwtxt[6]},
  435.     { 3,1,JAM1,54,70,NULL,plr1.name,&rwtxt[7]},
  436.     { 3,1,JAM1,230,70,NULL,intbuf[0],&rwtxt[8]},
  437.     { 3,1,JAM1,54,85,NULL,plr2.name,&rwtxt[9]},
  438.     { 3,1,JAM1,230,85,NULL,intbuf[1],&rwtxt[10]},
  439.     { 3,1,JAM1,54,100,NULL,plr3.name,&rwtxt[11]},
  440.     { 3,1,JAM1,230,100,NULL,intbuf[2],NULL}
  441. };
  442.  
  443. struct    Gadget    rwgad = /*round winner gadget(copied from about gadget)*/
  444. { NULL,118,120,7*FWIDTH+4,FHEIGHT+4,GADGHCOMP, RELVERIFY | ENDGADGET,
  445.   BOOLGADGET | REQGADGET,(APTR)&abprbrd,NULL,&abprtxt,NULL,NULL,PROCG,NULL
  446. };
  447.  
  448. USHORT    rwbrdcrds[] = {0,0,299,0,299,139,0,139,0,0};
  449. struct    Border    rwbrd = {0,0,3,0,JAM1,5,rwbrdcrds,NULL};
  450.  
  451. struct    Requester    rwreq = /*round winner requester*/
  452. { NULL,320,30,300,140,0,0,&rwgad,&rwbrd,rwtxt,NULL,7,NULL,{NULL},NULL,NULL,{NULL}};
  453.  
  454. /*game winner requester*/
  455. struct    IntuiText    gwtxt[] =
  456. {
  457.     { 4,1,JAM1,94,20,&italicfont,"Winner Of Game",&gwtxt[1]},
  458.     { 2,1,JAM1,122,30,NULL,"",&gwtxt[3]},
  459.     { 4,1,JAM1,110,20,&italicfont,"Game Drawn",&gwtxt[3]},
  460.     { 4,1,JAM1,114,5,&italicfont,"Game Over",&gwtxt[4]},
  461.     { 4,1,JAM1,38,50,&italicfont,"Final Scores For Each Player",&gwtxt[5]},
  462.     { 4,1,JAM1,30,60,NULL,"Player             Score  Wins",&gwtxt[6]},
  463.     { 3,1,JAM1,30,80,NULL,plr1.name,&gwtxt[7]},
  464.     { 3,1,JAM1,206,80,NULL,intbuf[0],&gwtxt[8]},
  465.     { 3,1,JAM1,30,95,NULL,plr2.name,&gwtxt[9]},
  466.     { 3,1,JAM1,206,95,NULL,intbuf[1],&gwtxt[10]},
  467.     { 3,1,JAM1,30,110,NULL,plr3.name,&gwtxt[11]},
  468.     { 3,1,JAM1,206,110,NULL,intbuf[2],&gwtxt[12]},
  469.     { 3,1,JAM1,256,80,NULL,intbuf[5],&gwtxt[13]},
  470.     { 3,1,JAM1,256,95,NULL,intbuf[6],&gwtxt[14]},
  471.     { 3,1,JAM1,256,110,NULL,intbuf[7],NULL},
  472. };
  473.  
  474. struct    Gadget    gwgad = /*game winner gadget(copied from about gadget)*/
  475. { NULL,118,120,7*FWIDTH+4,FHEIGHT+4,GADGHCOMP, RELVERIFY | ENDGADGET,
  476.   BOOLGADGET | REQGADGET,(APTR)&abprbrd,NULL,&abprtxt,NULL,NULL,PROCG,NULL
  477. };
  478.  
  479. struct    Requester    gwreq = /*game winner requester*/
  480. { NULL,150,30,300,140,0,0,&gwgad,&rwbrd,gwtxt,NULL,7,NULL,{NULL},NULL,NULL,{NULL}};
  481.  
  482.  
  483.  
  484.  
  485.  
  486. struct    Image    cardrem =    /*blank rectangle to remove cards from screen*/
  487. {    0,0,64,48,0,NULL,0,0,NULL };
  488. struct    Image    setrem =    /*blank to remove all sets from screen*/
  489. {    355,30,280,220,0,NULL,0,0,NULL};
  490. struct    Image    handrem =    /*blank to remove user hand*/
  491. {    0,0,17*6+68,48,0,NULL,0,0,NULL };
  492. struct    Image    packrem =    /*blank to remove both fup and fdp*/
  493. {    0,0,170,70,0,NULL,0,0,NULL };
  494.  
  495. USHORT    volatile    quit=0, mandeal, cont=0, numhand=7, contplay=0, exgm=0,    /* exit game */
  496.     initpack[2] = {1,0},
  497.     shufpack[2] = {1,0};    /*initialise/shuffle pack after hand/game*/
  498.  
  499. struct    Task    *tc;
  500. struct    MsgPort    *mp;
  501.  
  502. struct    set    setarr[6]; /*face up set*/
  503. struct    set *fupset[] =    /*array of pointers to faceupsets*/
  504. {    &setarr[0],&setarr[1],&setarr[2],&setarr[3],&setarr[4],&setarr[5] };
  505.     
  506. struct    card    fdp[53], fup[53];
  507. USHORT    fuptc,fdptc;
  508.  
  509. struct    Gadget    *gaddr;
  510.  
  511. struct    card    nulcard =
  512. { 0,0 };
  513.     
  514. char    out[8];
  515.  
  516. USHORT    ncs,cdsc[10];    /*number of condensed sets*/
  517. struct    suitset    ss[8];
  518. struct    numset    ns[14];
  519. struct    condset    cs[33],selcs[33],testcs[33];
  520.